<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>一证通线索表 管理</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
	<form id="yztTrackInfo_form">
		<div class="fieldset1 tabel_col clearFix">

			<div class="fieldBox col_25">
				<div class="label">名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
				<div class="field">
					<input id="cstNm" type="text" disabled="disabled"
						class="ui-textbox" value="${yztTrackInfoVO.cstNm}"
						validate="{required:true,maxlength:100}"> <span
						class="requiredSymbol"></span>
				</div>
			</div>
			<div class="fieldBox col_25">
				<div class="label">客户手机号</div>
				<div class="field">
					<input id="cstMp" type="text" disabled="disabled"
						class="ui-textbox" value="${yztTrackInfoVO.cstMp}"
						validate="{required:true,maxlength:30}"> <span
						class="requiredSymbol"></span>
				</div>
			</div>
			<div class="fieldBox col_25">
				<div class="label">地区（省）</div>
				<div class="field">
				<input id="rgnPrCd" type="text" disabled="disabled"
						class="ui-textbox" value="${yztTrackInfoVO.rgnPrCdNm}"
						validate="{required:true,maxlength:30}"> <span
						class="requiredSymbol"></span>
				</div>
			</div>
			<div class="fieldBox col_25">
				<div class="label">意向车型</div>
				<div class="field">
					<input id="preferMdl" type="text" disabled="disabled"
						class="ui-textbox" value="${yztTrackInfoVO.preferMdl}"
						validate="{required:true,maxlength:200}"> <span
						class="requiredSymbol"></span>
				</div>
			</div>
			<div class="fieldBox col_25  ">
				<div class="label">所需金额(万)</div>
				<div class="field">
					<select id="budgetCd" data-value="${yztTrackInfoVO.budgetCd}"
						validate="{required:true,select:false}">
						<option value="1">5~10</option>
						<option value="2">10~15</option>
						<option value="3">15~20</option>
						<option value="4">20以上</option>
					</select>
				</div>
			</div>
			<div class="fieldBox col_25">
				<div class="label">提报时间</div>
				<div class="field">
					<input id="preferMdl" type="text" disabled="disabled" style="width:180px;"
						class="ui-datepicker" value="${yztTrackInfoVO.createTime}"
						validate="{required:true,maxlength:200}"> <span
						class="requiredSymbol"></span>
				</div>
			</div>
			<div class="fieldBox col_25">
				<div class="label">状态</div>
				<div class="field">
					<select name="stsCd" id="stsCd"
						data-value="${yztTrackInfoVO.stsCd}"
						validate="{required:true,select:true}">
						<option value="1">未跟进</option>
						<option value="2">跟进中</option>
						<option value="3">已成交</option>
						<option value="4">已失单</option>
						<option value="5">无效信息</option>
					</select> <span class="requiredSymbol"></span>
				</div>
			</div>
			<div class="fieldBox col_25">
				<div class="label">关闭时间</div>
				<div class="field">
					<input id="preferMdl" type="text" disabled="disabled" style="width:180px;"
						class="ui-datepicker" value="${yztTrackInfoVO.updateTime}"
						validate="{required:true,maxlength:200}">
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label">备注</div>
				<div class="field">
					<textarea name="trcRem" id="trcRem" type="text" class="ui-textbox"  
						cols="125" rows="8" value="${yztTrackInfoVO.trcRem}"
						validate="{required:false,maxlength:1000}">${yztTrackInfoVO.trcRem}</textarea>
					<span class="requiredSymbol">*</span>
				</div>
			</div>
		</div>
		<!-- <div class="btnsBox">
			<span id="saveYztTrackInfo_Btn"
				class="sq-button sq-button-round l-dialog-btn-ok">保存</span> <input
				type="reset" id="resetBtn" class="l-button l-button-reset Hide">
		</div> -->
	</form>
	<script>
    $(function() {
        var yztTrackInfoId = "${yztTrackInfoVO.id}";//主键ID
        $("#yztTrackInfo_form").ligerForm({
            validate: true
        });
        //把下拉选设置成禁用
            var slt=liger.get("budgetCd");
            slt.setDisabled(true);
            var stsCd=liger.get("stsCd");
            stsCd.setDisabled(true);
            $("#trcRem").setDisabled_ligerTextarea(true);
        /*保存*/
        $("#saveYztTrackInfo_Btn").click(function (event) {
            var form = liger.get("yztTrackInfo_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            $.ligerDialog.hide();
            var _url;
            if (yztTrackInfoId == '') {//新增
                _url = '<%=path%>/yzt/yztTrackInfo/add.do';
            } else {//修改
                _url = '<%=path%>/yzt/yztTrackInfo/modify.do?id='+ yztTrackInfoId;
						}
						var wait_dialog;
						$.ajax({
							type : 'post',
							dataType : 'json',
							data : data,
							url : _url,
							beforeSend : function() {
								wait_dialog = $.ligerDialog.SQalert({
									content : LogUtils.LOG_CMM_DATA_LOADING,
									SQ_type : "waitting"
								});
							},
							success : function(msg) {
								wait_dialog.close();
								if (msg.success == 1) {
									$.ligerDialog.SQalert({
										content : msg.info,
										SQ_type : "success"
									});
									parent.$("#clearBtn").click();
									parent.$("#searchBtn").click();
									frameElement.dialog.close();

									//$("#resetBtn").click();
									//回调刷新列表
									//var callback=frameElement.W2W.callback;
									//Remove_navTab();
									//callback();
								} else {
									$.ligerDialog.SQalert({
										content : msg.info,
										SQ_type : "error"
									});
								}
							}
						});
					});
		});
	</script>
</body>
</html>
